/*
 * author: VDaras
 */

#ifndef APPLICATION_H
#define	APPLICATION_H

#include "../NonCopyable.h"
#include "../gui/gui_Screen.h"
#include "GraphicsCore.h"
#include "../audio/AudioCore.h"

class Camera;

namespace sdl
{

class Screen;

/**
 * Class modeling an SDL application. Provides an interface for further applications
 * to be derived from depending on the situation.
 */

class Application : public NonCopyable
{
protected:
    
    al::AudioCore *m_aCore;
    
    GraphicsCore *m_gCore;
    
    gui::Screen *m_gScreen;
    
    int m_framesPerSecond; //frame cap
   
    bool m_running;

public:
    Application();
   
    virtual ~Application();
    
    bool GetRunning();


    /**
     * Initializes the Application's graphics core and gui screen.
     *
     * @param screenW - screen's width
     * @param screenH - screen's height
     * @param bpp - bits per pixel
     * @param fullscreen - if true, the application will be fullscreen
     * @return a boolean value indicating if initialization was successful or
     * not.
     */

    virtual bool Init(int screenW, int screenH, int bpp, bool fullscreen = false);


    /**
     * Override this one to modify the Application's behavior.
     *
     * @return an Application exit code.
     */

    virtual int Run() = 0;


    /**
     * Sets the m_running flag of the Application to false.
     */

    virtual void Exit();

    /**
     * @return A pointer to the Application's GraphicsCore
     */

    GraphicsCore *GetGraphicsCore();
    
    
    /**
     * @return A pointer to the application's gui screen.
     */
    
    gui::Screen* GetGuiScreen();
};

};

#endif	/* APPLICATION_H */

